package csel.model.skills;

import csel.model.CharacterStats;
import csel.model.entity.Character;
import csel.model.items.Weapon;

public class OneHanded extends PassiveSkill
{
	private static final long serialVersionUID = 5L;

	public OneHanded(Character owner)
	{
		super(owner);
		setName("one-handed weapon");
		setDescription("the higher this skill, the better a Smasher will be when fighting with a one-handed weapon.");
	}

	@Override
	public int applyBonus(CharacterStats cs, int value)
	{
		if(cs == CharacterStats.OneHanded)
		{
			return(value + getPointsAllocated());
		}
		else
		{
			return(value);
		}
	}
	
	@Override
	public int applyOffensiveBonus(Weapon w, int value)
	{ 
		if(w == null)
		{
			return value;
		}
		switch(w.getMyType())
		{
		case onehanded:
			return (int)(w.getBaseUseableOffense() * Math.pow(1.5, getPointsAllocated()));
			default:
				return(value);
		}
	}
}
